import { createApp } from 'vue'
import App from '@/App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
const app = createApp(App)
app.use(ElementPlus, { locale: zhCn })
// svg插件需要配置代码
import 'virtual:svg-icons-register'
// 自定义全局组件并安装
import globalComponents from '@/components'
app.use(globalComponents)
// 引入全局样式
import '@/styles/index.scss'
// 引入路由
import router from './router'
// 全局组件icon
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 引入pinia仓库
import pinia from './store'
app.use(pinia)
app.use(router)
// 引入路由鉴权文件
import './permission'
app.mount('#app')
